package Time;

import java.time.LocalDate;
import java.time.Period;
import java.time.temporal.ChronoUnit;

public class Tool {
    public static void main(String[] args) {
//        //Period 间隔
//        LocalDate today=LocalDate.now();
//        System.out.println(today);
//
//        LocalDate birth=LocalDate.of(2000,1,1);
//        System.out.println(birth);
//
//        Period period=Period.between(birth,today);
//        System.out.println(period);
//
//        System.out.println(period.getYears());
//        System.out.println(period.getMonths());
//        System.out.println(period.getDays());
//
//        System.out.println(period.toTotalMonths());

        //Duration
        //侧重s跟ns的间隔


        //ChronoUnit 用的最多 最全面
//        ChronoUnit.YEARS.between()
//        ChronoUnit.MONTHS.between()
//        ChronoUnit.DAYS.between()
//        ChronoUnit.HOURS.between()
        //HALF_DAYS     DECADES    CENTURIES  MILLENNIA  ERAS



    }


}
